from rest_framework.generics import ListAPIView
from rest_framework.views import APIView

from apps.goods.models import SPUSpecification
from apps.meiduo_admin.serializers.spus import SPUSpecificationSerializer


# class SPUSpecView(APIView):
#
#     def get(self, request, pk):
#         pass


class SPUSpecView(ListAPIView):

    serializer_class = SPUSpecificationSerializer

    def get_queryset(self):
        pk = self.kwargs.get('pk')
        queryset = SPUSpecification.objects.filter(spu_id=pk)
        return queryset
